import sun.rmi.runtime.Log;

public class Main {
    public static void main(String[] args) {

        LinkedList<Integer> linkedList = new LinkedList<>();
        for (int i = 0; i < 5; i++) {
            linkedList.addFirst(i);
            System.out.println("size=" + linkedList.getSize() + " " + linkedList);
        }
        linkedList.add(3,99);
        System.out.println("size=" + linkedList.getSize() + " " + linkedList);
        //System.out.println(linkedList.contains(linkedList.getHead(), -1));
        //System.out.println(linkedList.contains(linkedList.getHead(), 1));

        //System.out.println(linkedList);
        //linkedList.addFirst(5);
        //System.out.println(linkedList);
        //linkedList.addLast(-1);
        //linkedList.add(5,-99);
        //System.out.println("size=" + linkedList.getSize() + " " + linkedList);
        //linkedList.set(2, 33);
        //System.out.println(linkedList);
        //linkedList.remove(2);
        //System.out.println(linkedList);
        linkedList.removeFirst();
        System.out.println("size=" + linkedList.getSize() + " " + linkedList);
        linkedList.removeLast();
        System.out.println("size=" + linkedList.getSize() + " " + linkedList);


    }
}
